﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using PPI.General;
using PPI.WebConsumer.PPI.Svc;

namespace PPI.WebConsumer.Utility
{
    public class WUtiilty_Asset_XMissionStructure
    {

        public static Int32 DuplicateByInspection(Int32 inspectionId)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.DUtility_Asset_XMissionStructures_DuplicateByInspection(inspectionId, reader.ConectionMode);
        }

        public static Int32 DuplicateByVisit(Int32 visitId)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.DUtility_Asset_XMissionStructures_DuplicateByVisit(visitId, reader.ConectionMode);
        }

        public static Int32 AssociateWithInspection(Int32 inspectionid, Int32 utilityId)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.DUtility_Asset_XMissionStructures_AssociateWithInspection(inspectionid,utilityId, reader.ConectionMode);
        }
        
        public static Int32 AssociateWithVisit(Int32 visitId, Int32 utilityId)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.DUtility_Asset_XMissionStructures_AssociateWithVisit(visitId, utilityId, reader.ConectionMode);
        }

        public static DataSet SelectNearLatitudeLongitude(double latitude,double longitude)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.DUtility_Asset_XMissionStructures_SelectAllNearByLatitudeLongitude(latitude, longitude, reader.ConectionMode);

        }

        public static void AutolinkInspection(double maxdistanceInMts)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            svc.DUtility_Asset_XMissionStructures_AutolinkInspection(maxdistanceInMts,reader.ConectionMode);

        }

        public static void AutolinkVendor(double maxdistanceInMts)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            svc.DUtility_Asset_XMissionStructures_AutolinkVendor(maxdistanceInMts, reader.ConectionMode);

        }
    }
}
